<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <link href="https://cdn.bootcss.com/twitter-bootstrap/3.0.1/css/bootstrap.min.css" rel="stylesheet">
    </head>
    <body>
        <div class="container">
            <div class="row clearfix">
                <div class="col-md-12 column">
                    <h1 class="text-center ">
                        客户欠款管理
                    </h1>
                    <h3 class="text-right text-success">
                        欢迎您:XXX
                        <#--<@shiro.principal property="name" />-->
                    </h3>


                    <div class="form-group">
                        <div class="col-sm-2">
                            <button type="button" class="btn btn-default btn-block"
                                    value="" style="background-color: cornflowerblue;font-size: large"
                            >筛选查询</button>
                        </div>
                    </div>

                    <form role="form" action="/debt/list" method="post">
                        <div class="col-sm-offset-10 col-sm-0">
                            <button type="submit" class="btn btn-lg btn-success"
                            >查询</button>

                        </div>

                        <div class="col-md-6 column">
                            <div class="form-group">
                                <label for="clientName">客户名称</label>
                                <input type="text" class="form-control"
                                       id="clientName" name="clientName" value="${clientName!}"/>
                            </div>
                        </div>
                        <div class="col-md-6 column">
                            <div class="form-group">
                                <label for="clientChannel">客户渠道</label>
                                <input type="text" class="form-control"
                                       id="clientChannel" name="clientChannel" value="${clientChannel!}"/>
                            </div>
                        </div>

                    </form>
                    <div class="form-group">
                        <div class="col-sm-2">
                            <button type="button" class="btn btn-default btn-block"
                                    value="" style="background-color: cornflowerblue;font-size: large"
                            >数据列表</button>
                        </div>
                    </div>
                    <table class="table">
                        <thead>
                        <tr>
                            <th>客户名称</th>
                            <th>联系人</th>
                            <th>电话号码</th>
                            <th>客户渠道</th>
                            <th>欠款金额</th>
                            <th>客户地址</th>
                            <th>清欠日期</th>
                            <th>最大欠款额度</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <#--                    c:forEach items='${pageInfo.list}'  var='trip'-->
                        <#list pageInfo.list as debt>
                            <tr class="info">
                                <td>${debt.clientName!''}</td>
                                <td>${debt.contact!''}</td>
                                <td>${debt.phone!''}</td>
                                <td>${debt.clientChannel!''}</td>
                                <td>${debt.owe!''}</td>
                                <td>${debt.clientAddress!''}</td>
                                <td>
                            <#if  (debt.repaymentDate??)>
                                    ${debt.repaymentDate?string('yyyy-MM-dd')}
                                </#if>
                                     <#--<#if  (debt.repaymentDate??)>-->
                                        <#---->
                                     <#--</#if>-->
                                    <#--                                ${trip.startDate?string('yyyy-MM-dd')time} 展示年月日时分秒-->
                                    <#--                                ${trip.startDate?time} 展示时分秒-->
                                </td>
                                <td>
                                    ${debt.oweMax!''}
                                </td>
                                <#--<td>-->
                                    <#--<img style="width: 100px;height: 100px;" src="${trip.tripPic}" />-->
                                <#--</td>-->
                                <td>
                                    <button type="button" class="btn btn-default btn-warning"
                                            onclick="location.href='/debt/warn-ui?did=${debt.did}'">欠款提醒</button>
                                    <button type="button" class="btn btn-info"
                                    onclick="location.href='/debt/order-list?did=${debt.did}'">欠还款记录</button>
                                    <button type="button" class="btn btn-default btn-danger"
                                    onclick="location.href='/debt/order-add-ui?did=${debt.did}'">收欠款</button>

                                </td>
                            </tr>
                        </#list>

                        </tbody>
                    </table>
                    <ul class="pagination" style="float: right">


                        <#if pageInfo.hasPreviousPage >
                            <li>
                                <a href="javascript:;" onclick="location.href='/debt/list?index=1'">首页</a>
                            </li>

                            <li>
                                <a href="javascript:;" onclick="location.href='/debt/list?index=${pageInfo.prePage}'">上一页</a>
                            </li>
                        </#if>


                        <#if pageInfo.pageNum lt pageInfo.pages >
                            <li>
                                <a href="javascript:;" onclick="location.href='/debt/list?index=${pageInfo.nextPage}'">下一页</a>
                            </li>
                            <li>
                                <a href="javascript:;" onclick="location.href='/debt/list?index=${pageInfo.pages}'">尾页</a>
                            </li>
                        </#if>
                    </ul>
                </div>
            </div>
        </div>
        <script src="/static/js/jquery-1.8.0.min.js" ></script>
        <script>

            // 页面加载完毕.
            // $(function(){
            //     $.getJSON(
            //         "/user/get-name",
            //         null,
            //         function(result){
            //             if(result.code == 0){
            //                 $("#name").html(result.data);
            //             }else{
            //                 location.href = "/user/login-ui";
            //             }
            //         }
            //     );
            // });


        </script>
    </body>
</html>